﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdDb3dSolid : OdDbEntity
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDb3dSolid(IntPtr cPtr, bool cMemoryOwn) : base(TD_DbPINVOKE.OdDb3dSolid_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDb3dSolid obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDb3dSolid()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdDb3dSolid(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdDb3dSolid cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDb3dSolid_cast(OdRxObject.getCPtr(pObj));
			OdDb3dSolid result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDb3dSolid)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDb3dSolid)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDb3dSolid)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDb3dSolid_desc(), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDb3dSolid_isA(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDb3dSolid_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdDb3dSolid createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDb3dSolid_createObject();
			OdDb3dSolid result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDb3dSolid)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDb3dSolid)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDb3dSolid)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isNull()
		{
			bool result = TD_DbPINVOKE.OdDb3dSolid_isNull(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult acisOut(OdStreamBuf pStreamBuf, int typeVer)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_acisOut__SWIG_0(this.swigCPtr, OdStreamBuf.getCPtr(pStreamBuf), typeVer);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult acisOut(OdStreamBuf pStreamBuf)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_acisOut__SWIG_1(this.swigCPtr, OdStreamBuf.getCPtr(pStreamBuf));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult acisIn(OdStreamBuf pStreamBuf, out int pTypeVer)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_acisIn__SWIG_0(this.swigCPtr, OdStreamBuf.getCPtr(pStreamBuf), out pTypeVer);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult acisIn(OdStreamBuf pStreamBuf)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_acisIn__SWIG_1(this.swigCPtr, OdStreamBuf.getCPtr(pStreamBuf));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void brep(OdBrBrep brep)
		{
			TD_DbPINVOKE.OdDb3dSolid_brep(this.swigCPtr, OdBrBrep.getCPtr(brep));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual bool subWorldDraw(OdGiWorldDraw pWd)
		{
			bool result = TD_DbPINVOKE.OdDb3dSolid_subWorldDraw(this.swigCPtr, OdGiWorldDraw.getCPtr(pWd));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void subViewportDraw(OdGiViewportDraw pVd)
		{
			TD_DbPINVOKE.OdDb3dSolid_subViewportDraw(this.swigCPtr, OdGiViewportDraw.getCPtr(pVd));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult dwgInFields(OdDbDwgFiler pFiler)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_dwgInFields(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void dwgOutFields(OdDbDwgFiler pFiler)
		{
			TD_DbPINVOKE.OdDb3dSolid_dwgOutFields(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult dxfInFields(OdDbDxfFiler pFiler)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_dxfInFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void dxfOutFields(OdDbDxfFiler pFiler)
		{
			TD_DbPINVOKE.OdDb3dSolid_dxfOutFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult subGetClassID(IntPtr pClsid)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_subGetClassID(this.swigCPtr, pClsid);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void createBox(double xLen, double yLen, double zLen)
		{
			TD_DbPINVOKE.OdDb3dSolid_createBox(this.swigCPtr, xLen, yLen, zLen);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void createFrustum(double height, double xRadius, double yRadius, double topXRadius)
		{
			TD_DbPINVOKE.OdDb3dSolid_createFrustum(this.swigCPtr, height, xRadius, yRadius, topXRadius);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void createSphere(double radius)
		{
			TD_DbPINVOKE.OdDb3dSolid_createSphere(this.swigCPtr, radius);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void createTorus(double majorRadius, double minorRadius)
		{
			TD_DbPINVOKE.OdDb3dSolid_createTorus(this.swigCPtr, majorRadius, minorRadius);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void createWedge(double xLen, double yLen, double zLen)
		{
			TD_DbPINVOKE.OdDb3dSolid_createWedge(this.swigCPtr, xLen, yLen, zLen);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdResult extrude(OdDbRegion pRegion, double height, double taperAngle)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_extrude__SWIG_0(this.swigCPtr, OdDbRegion.getCPtr(pRegion), height, taperAngle);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult extrude(OdDbRegion pRegion, double height)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_extrude__SWIG_1(this.swigCPtr, OdDbRegion.getCPtr(pRegion), height);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult revolve(OdDbRegion pRegion, OdGePoint3d axisPoint, OdGeVector3d axisDir, double angleOfRevolution)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_revolve(this.swigCPtr, OdDbRegion.getCPtr(pRegion), OdGePoint3d.getCPtr(axisPoint), OdGeVector3d.getCPtr(axisDir), angleOfRevolution);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult booleanOper(BoolOperType operation, OdDb3dSolid solid)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_booleanOper(this.swigCPtr, (int)operation, OdDb3dSolid.getCPtr(solid));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult extrudeAlongPath(OdDbRegion region, OdDbCurve path, double taperAngle)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_extrudeAlongPath__SWIG_0(this.swigCPtr, OdDbRegion.getCPtr(region), OdDbCurve.getCPtr(path), taperAngle);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult extrudeAlongPath(OdDbRegion region, OdDbCurve path)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_extrudeAlongPath__SWIG_1(this.swigCPtr, OdDbRegion.getCPtr(region), OdDbCurve.getCPtr(path));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult imprintEntity(OdDbEntity pEntity)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_imprintEntity(this.swigCPtr, OdDbEntity.getCPtr(pEntity));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult getArea(out double area)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_getArea(this.swigCPtr, out area);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult checkInterference(OdDb3dSolid otherSolid, bool createNewSolid, out bool solidsInterfere, out OdDb3dSolid commonVolumeSolid)
		{
			IntPtr zero = IntPtr.Zero;
			OdResult result;
			try
			{
				OdResult odResult = (OdResult)TD_DbPINVOKE.OdDb3dSolid_checkInterference(this.swigCPtr, OdDb3dSolid.getCPtr(otherSolid), createNewSolid, out solidsInterfere, out zero);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				result = odResult;
			}
			finally
			{
				commonVolumeSolid = (OdDb3dSolid)Teigha.Core.Helpers.odrxCreateObjectInternal(zero, true);
			}
			return result;
		}

		public virtual OdResult getMassProp(out double volume, OdGePoint3d centroid, double[] momInertia, double[] prodInertia, double[] prinMoments, OdGeVector3d prinAxes, double[] radiiGyration, OdGeExtents3d extents)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_getMassProp(this.swigCPtr, out volume, OdGePoint3d.getCPtr(centroid), momInertia, prodInertia, prinMoments, OdGeVector3d.getCPtr(prinAxes), radiiGyration, OdGeExtents3d.getCPtr(extents));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult getSection(OdGePlane plane, out OdDbRegion sectionRegion)
		{
			IntPtr zero = IntPtr.Zero;
			OdResult result;
			try
			{
				OdResult odResult = (OdResult)TD_DbPINVOKE.OdDb3dSolid_getSection(this.swigCPtr, OdGePlane.getCPtr(plane), out zero);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				result = odResult;
			}
			finally
			{
				sectionRegion = (OdDbRegion)Teigha.Core.Helpers.odrxCreateObjectInternal(zero, true);
			}
			return result;
		}

		public virtual OdResult getSlice(OdGePlane plane, bool bGetNegHalfToo, out OdDb3dSolid pNegHalfSolid)
		{
			IntPtr zero = IntPtr.Zero;
			OdResult result;
			try
			{
				OdResult odResult = (OdResult)TD_DbPINVOKE.OdDb3dSolid_getSlice__SWIG_0(this.swigCPtr, OdGePlane.getCPtr(plane), bGetNegHalfToo, out zero);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				result = odResult;
			}
			finally
			{
				pNegHalfSolid = (OdDb3dSolid)Teigha.Core.Helpers.odrxCreateObjectInternal(zero, true);
			}
			return result;
		}

		public virtual OdResult getSlice(OdDbSurface pSurface, bool bGetNegHalfToo, out OdDb3dSolid pNegHalfSolid)
		{
			IntPtr zero = IntPtr.Zero;
			OdResult result;
			try
			{
				OdResult odResult = (OdResult)TD_DbPINVOKE.OdDb3dSolid_getSlice__SWIG_1(this.swigCPtr, OdDbSurface.getCPtr(pSurface), bGetNegHalfToo, out zero);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				result = odResult;
			}
			finally
			{
				pNegHalfSolid = (OdDb3dSolid)Teigha.Core.Helpers.odrxCreateObjectInternal(zero, true);
			}
			return result;
		}

		public virtual OdResult cleanBody()
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_cleanBody(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult offsetBody(double offsetDistance)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_offsetBody(this.swigCPtr, offsetDistance);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult separateBody(OdDb3dSolidPtrArray newSolids)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_separateBody(this.swigCPtr, OdDb3dSolidPtrArray.getCPtr(newSolids));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult createExtrudedSolid(OdDbEntity pSweepEnt, OdGeVector3d directionVec, OdDbSweepOptions sweepOptions)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_createExtrudedSolid__SWIG_0(this.swigCPtr, OdDbEntity.getCPtr(pSweepEnt), OdGeVector3d.getCPtr(directionVec), OdDbSweepOptions.getCPtr(sweepOptions));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult createExtrudedSolid(OdDbEntity pSweepEnt, OdDbSubentId faceSubentId, OdGeVector3d directionVec, OdDbSweepOptions sweepOptions)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_createExtrudedSolid__SWIG_1(this.swigCPtr, OdDbEntity.getCPtr(pSweepEnt), OdDbSubentId.getCPtr(faceSubentId), OdGeVector3d.getCPtr(directionVec), OdDbSweepOptions.getCPtr(sweepOptions));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult createExtrudedSolid(OdDbEntity pSweepEnt, OdDbSubentId faceSubentId, double height, OdDbSweepOptions sweepOptions)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_createExtrudedSolid__SWIG_2(this.swigCPtr, OdDbEntity.getCPtr(pSweepEnt), OdDbSubentId.getCPtr(faceSubentId), height, OdDbSweepOptions.getCPtr(sweepOptions));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult createLoftedSolid(OdDbEntityPtrArray crossSectionCurves, OdDbEntityPtrArray guideCurves, OdDbEntity pPathCurve, OdDbLoftOptions loftOptions)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_createLoftedSolid(this.swigCPtr, OdDbEntityPtrArray.getCPtr(crossSectionCurves), OdDbEntityPtrArray.getCPtr(guideCurves), OdDbEntity.getCPtr(pPathCurve), OdDbLoftOptions.getCPtr(loftOptions));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult createPyramid(double height, int sides, double radius, double topRadius)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_createPyramid__SWIG_0(this.swigCPtr, height, sides, radius, topRadius);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult createPyramid(double height, int sides, double radius)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_createPyramid__SWIG_1(this.swigCPtr, height, sides, radius);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult createRevolvedSolid(OdDbEntity pRevEnt, OdGePoint3d axisPnt, OdGeVector3d axisDir, double revAngle, double startAngle, OdDbRevolveOptions revolveOptions)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_createRevolvedSolid__SWIG_0(this.swigCPtr, OdDbEntity.getCPtr(pRevEnt), OdGePoint3d.getCPtr(axisPnt), OdGeVector3d.getCPtr(axisDir), revAngle, startAngle, OdDbRevolveOptions.getCPtr(revolveOptions));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult createRevolvedSolid(OdDbEntity pRevEnt, OdDbSubentId faceSubentId, OdGePoint3d axisPnt, OdGeVector3d axisDir, double revAngle, double startAngle, OdDbRevolveOptions revolveOptions)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_createRevolvedSolid__SWIG_1(this.swigCPtr, OdDbEntity.getCPtr(pRevEnt), OdDbSubentId.getCPtr(faceSubentId), OdGePoint3d.getCPtr(axisPnt), OdGeVector3d.getCPtr(axisDir), revAngle, startAngle, OdDbRevolveOptions.getCPtr(revolveOptions));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult createSweptSolid(OdDbEntity pSweepEnt, OdDbSubentId faceSubentId, OdDbEntity pPathEnt, OdDbSweepOptions sweepOptions)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_createSweptSolid__SWIG_0(this.swigCPtr, OdDbEntity.getCPtr(pSweepEnt), OdDbSubentId.getCPtr(faceSubentId), OdDbEntity.getCPtr(pPathEnt), OdDbSweepOptions.getCPtr(sweepOptions));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult createSweptSolid(OdDbEntity pSweepEnt, OdDbEntity pPathEnt, OdDbSweepOptions sweepOptions)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_createSweptSolid__SWIG_1(this.swigCPtr, OdDbEntity.getCPtr(pSweepEnt), OdDbEntity.getCPtr(pPathEnt), OdDbSweepOptions.getCPtr(sweepOptions));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void stlOut(string filename, bool asciiFormat)
		{
			TD_DbPINVOKE.OdDb3dSolid_stlOut(this.swigCPtr, filename, asciiFormat);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdDbObject decomposeForSave(DwgVersion ver, OdDbObjectId replaceId, out bool exchangeXData)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDb3dSolid_decomposeForSave(this.swigCPtr, (int)ver, OdDbObjectId.getCPtr(replaceId), out exchangeXData);
			OdDbObject result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbObject)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbObject)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbObject)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult subExplode(OdRxObjectPtrArray entitySet)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_subExplode(this.swigCPtr, OdRxObjectPtrArray.getCPtr(entitySet));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult subTransformBy(OdGeMatrix3d xfm)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_subTransformBy(this.swigCPtr, OdGeMatrix3d.getCPtr(xfm));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void saveAs(OdGiWorldDraw pWd, DwgVersion ver)
		{
			TD_DbPINVOKE.OdDb3dSolid_saveAs(this.swigCPtr, OdGiWorldDraw.getCPtr(pWd), (int)ver);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdResult setBody(IntPtr pGeometry)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_setBody(this.swigCPtr, pGeometry);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual IntPtr body()
		{
			IntPtr result = TD_DbPINVOKE.OdDb3dSolid_body(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult copyEdge(OdDbSubentId subentId, out OdDbEntity newEntity)
		{
			IntPtr zero = IntPtr.Zero;
			OdResult result;
			try
			{
				OdResult odResult = (OdResult)TD_DbPINVOKE.OdDb3dSolid_copyEdge(this.swigCPtr, OdDbSubentId.getCPtr(subentId), out zero);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				result = odResult;
			}
			finally
			{
				newEntity = (OdDbEntity)Teigha.Core.Helpers.odrxCreateObjectInternal(zero, true);
			}
			return result;
		}

		public virtual OdResult copyFace(OdDbSubentId subentId, out OdDbEntity newEntity)
		{
			IntPtr zero = IntPtr.Zero;
			OdResult result;
			try
			{
				OdResult odResult = (OdResult)TD_DbPINVOKE.OdDb3dSolid_copyFace(this.swigCPtr, OdDbSubentId.getCPtr(subentId), out zero);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				result = odResult;
			}
			finally
			{
				newEntity = (OdDbEntity)Teigha.Core.Helpers.odrxCreateObjectInternal(zero, true);
			}
			return result;
		}

		public new virtual OdResult subGetSubentPathsAtGsMarker(SubentType type, IntPtr gsMark, OdGePoint3d pickPoint, OdGeMatrix3d viewXform, OdDbFullSubentPathArray subentPaths, OdDbObjectIdArray pEntAndInsertStack)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_subGetSubentPathsAtGsMarker__SWIG_0(this.swigCPtr, (int)type, gsMark, OdGePoint3d.getCPtr(pickPoint), OdGeMatrix3d.getCPtr(viewXform), OdDbFullSubentPathArray.getCPtr(subentPaths), OdDbObjectIdArray.getCPtr(pEntAndInsertStack));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult subGetSubentPathsAtGsMarker(SubentType type, IntPtr gsMark, OdGePoint3d pickPoint, OdGeMatrix3d viewXform, OdDbFullSubentPathArray subentPaths)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_subGetSubentPathsAtGsMarker__SWIG_1(this.swigCPtr, (int)type, gsMark, OdGePoint3d.getCPtr(pickPoint), OdGeMatrix3d.getCPtr(viewXform), OdDbFullSubentPathArray.getCPtr(subentPaths));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdDbSubentId internalSubentId(IntPtr ent)
		{
			OdDbSubentId result = new OdDbSubentId(TD_DbPINVOKE.OdDb3dSolid_internalSubentId(this.swigCPtr, ent), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual IntPtr internalSubentPtr(OdDbSubentId id)
		{
			IntPtr result = TD_DbPINVOKE.OdDb3dSolid_internalSubentPtr(this.swigCPtr, OdDbSubentId.getCPtr(id));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult subGetGsMarkersAtSubentPath(OdDbFullSubentPath subPath, SWIGTYPE_p_OdGsMarkerArray gsMarkers)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_subGetGsMarkersAtSubentPath(this.swigCPtr, OdDbFullSubentPath.getCPtr(subPath), SWIGTYPE_p_OdGsMarkerArray.getCPtr(gsMarkers));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdDbEntity subSubentPtr(OdDbFullSubentPath id)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDb3dSolid_subSubentPtr(this.swigCPtr, OdDbFullSubentPath.getCPtr(id));
			OdDbEntity result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbEntity)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbEntity)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbEntity)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult extrudeFaces(OdDbSubentIdArray faceSubentIds, double height, double taper)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_extrudeFaces(this.swigCPtr, OdDbSubentIdArray.getCPtr(faceSubentIds), height, taper);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult extrudeFacesAlongPath(OdDbSubentIdArray faceSubentIds, OdDbCurve path)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_extrudeFacesAlongPath(this.swigCPtr, OdDbSubentIdArray.getCPtr(faceSubentIds), OdDbCurve.getCPtr(path));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult taperFaces(OdDbSubentIdArray faceSubentIds, OdGePoint3d basePoint, OdGeVector3d draftVector, double draftAngle)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_taperFaces(this.swigCPtr, OdDbSubentIdArray.getCPtr(faceSubentIds), OdGePoint3d.getCPtr(basePoint), OdGeVector3d.getCPtr(draftVector), draftAngle);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult transformFaces(OdDbSubentIdArray faceSubentIds, OdGeMatrix3d matrix)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_transformFaces(this.swigCPtr, OdDbSubentIdArray.getCPtr(faceSubentIds), OdGeMatrix3d.getCPtr(matrix));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult removeFaces(OdDbSubentIdArray faceSubentIds)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_removeFaces(this.swigCPtr, OdDbSubentIdArray.getCPtr(faceSubentIds));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult offsetFaces(OdDbSubentIdArray faceSubentIds, double offsetDistance)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_offsetFaces(this.swigCPtr, OdDbSubentIdArray.getCPtr(faceSubentIds), offsetDistance);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult shellBody(OdDbSubentIdArray faceSubentIds, double offsetDistance)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_shellBody(this.swigCPtr, OdDbSubentIdArray.getCPtr(faceSubentIds), offsetDistance);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual uint numChanges()
		{
			uint result = TD_DbPINVOKE.OdDb3dSolid_numChanges(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult setSubentColor(OdDbSubentId subentId, OdCmColor color)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_setSubentColor(this.swigCPtr, OdDbSubentId.getCPtr(subentId), OdCmColor.getCPtr(color));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult getSubentColor(OdDbSubentId subentId, OdCmColor color)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_getSubentColor(this.swigCPtr, OdDbSubentId.getCPtr(subentId), OdCmColor.getCPtr(color));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult setSubentMaterial(OdDbSubentId subentId, OdDbObjectId matId)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_setSubentMaterial(this.swigCPtr, OdDbSubentId.getCPtr(subentId), OdDbObjectId.getCPtr(matId));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult getSubentMaterial(OdDbSubentId subentId, OdDbObjectId matId)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_getSubentMaterial(this.swigCPtr, OdDbSubentId.getCPtr(subentId), OdDbObjectId.getCPtr(matId));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult setSubentMaterialMapper(OdDbSubentId subentId, OdGiMapper mapper)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_setSubentMaterialMapper(this.swigCPtr, OdDbSubentId.getCPtr(subentId), OdGiMapper.getCPtr(mapper));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult getSubentMaterialMapper(OdDbSubentId subentId, OdGiMapper mapper)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_getSubentMaterialMapper(this.swigCPtr, OdDbSubentId.getCPtr(subentId), OdGiMapper.getCPtr(mapper));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult chamferEdges(OdDbSubentIdArray edgeSubentIds, OdDbSubentId baseFaceSubentId, double baseDist, double otherDist)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_chamferEdges(this.swigCPtr, OdDbSubentIdArray.getCPtr(edgeSubentIds), OdDbSubentId.getCPtr(baseFaceSubentId), baseDist, otherDist);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult filletEdges(OdDbSubentIdArray edgeSubentIds, OdGeDoubleArray radius, OdGeDoubleArray startSetback, OdGeDoubleArray endSetback)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_filletEdges(this.swigCPtr, OdDbSubentIdArray.getCPtr(edgeSubentIds), OdGeDoubleArray.getCPtr(radius), OdGeDoubleArray.getCPtr(startSetback), OdGeDoubleArray.getCPtr(endSetback));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult createFrom(OdDbEntity pFromEntity)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_createFrom(this.swigCPtr, OdDbEntity.getCPtr(pFromEntity));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool recordHistory()
		{
			bool result = TD_DbPINVOKE.OdDb3dSolid_recordHistory(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool showHistory()
		{
			bool result = TD_DbPINVOKE.OdDb3dSolid_showHistory(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult setRecordHistory(bool bRecord)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_setRecordHistory(this.swigCPtr, bRecord);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult setShowHistory(bool bShow)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_setShowHistory(this.swigCPtr, bShow);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult convertToBrepAtSubentPaths(OdDbFullSubentPathArray arg0)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_convertToBrepAtSubentPaths(this.swigCPtr, OdDbFullSubentPathArray.getCPtr(arg0));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual uint subSetAttributes(OdGiDrawableTraits pTraits)
		{
			uint result = TD_DbPINVOKE.OdDb3dSolid_subSetAttributes(this.swigCPtr, OdGiDrawableTraits.getCPtr(pTraits));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult projectOnToSolid(OdDbEntity pEntityToProject, OdGeVector3d projectionDirection, OdDbEntityPtrArray projectedEntities)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_projectOnToSolid(this.swigCPtr, OdDbEntity.getCPtr(pEntityToProject), OdGeVector3d.getCPtr(projectionDirection), OdDbEntityPtrArray.getCPtr(projectedEntities));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult createSculptedSolid(OdDbEntityPtrArray limitingBodies, OdIntArray limitingFlags)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDb3dSolid_createSculptedSolid(this.swigCPtr, OdDbEntityPtrArray.getCPtr(limitingBodies), OdIntArray.getCPtr(limitingFlags).Handle);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void subClose()
		{
			TD_DbPINVOKE.OdDb3dSolid_subClose(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
